<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>
<body>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/default.css">

<!-- Custom styles for this template -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/dashboard.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/adminnav.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/style.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.js"></script>
<script src="${pageContext.request.contextPath}/static/js/functions.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/prettify.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/multiselect.min.js"></script>

<script type="text/javascript">
    $(document).ready(
        function () {
            var currentPage = ${page.currentPage};
            var totalPage = ${page.totalPage};

            $("#pagination1").pagination({
                currentPage: currentPage,
                totalPage: totalPage,
                callback: function (current) {//current 当前页
                    var info = $("#pagination1").pagination("getPage");
                    location.href = "${pageContext.request.contextPath}/size/sizeList?currentPage=" + info.current;
                }
            });
        });
</script>

<c:import url="../common/adminTopNav.jsp"/>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">

            <c:import url="../common/adminLeftNav.jsp"/>

        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <%--content--%>

            <div class="row">
                <div class="col-md-12">


                    <h3>订单详细信息</h3>
                    <table class="table table-condensed table-hover">
                        <tbody>
                        <tr>
                            <td>订单编号：${orderVo.order.oid}</td>
                            <td>创建时间：<fmt:formatDate value="${orderVo.order.date}" pattern="yyyy-MM-dd"/></td>
                        </tr>
                        <tr>
                            <td>
                                订单状态：<span id="orderStatus">
                                    <c:if test="${orderVo.order.status==-3}">交易关闭</c:if>
                                    <c:if test="${orderVo.order.status==-2}">退款成功</c:if>
                                    <c:if test="${orderVo.order.status==-4}">退货成功</c:if>
                                    <c:if test="${orderVo.order.status==-1}">退款待通过</c:if>
                                    <c:if test="${orderVo.order.status==-5}">退货待通过</c:if>
                                    <c:if test="${orderVo.order.status==-6}">退货中</c:if>
                                    <c:if test="${orderVo.order.status==0}">等待付款</c:if>
                                    <c:if test="${orderVo.order.status==1}">未发货</c:if>
                                    <c:if test="${orderVo.order.status==2}">已发货</c:if>
                                    <c:if test="${orderVo.order.status==3}">交易成功</c:if>
									  </span>
                            </td>
                            <td>送货地址：${orderVo.order.address}</td>
                        </tr>

                        <tr>
                            <td>运单编号：<span
                                    id="orderPC">${empty orderVo.order.postCode?"暂无":orderVo.order.postCode}</span>
                            </td>
                            <td>快递名称：<span
                                    id="orderPN">${empty orderVo.order.postCompany?"暂无":orderVo.order.postCompany}</span>
                            </td>
                        </tr>

                        </tbody>
                    </table>


                    <div class="panel panel-info">
                        <div class="panel-heading">商品列表</div>
                        <div class="panel-body">
                            <table class="table table-hover table-condensed">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>商品图片</th>
                                    <th>商品名称</th>
                                    <th>商品单价</th>
                                    <th>数量</th>
                                    <th>小计</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${orderVo.itemList}" var="item" varStatus="status">
                                    <tr>
                                        <td>
                                                ${status.count}
                                        </td>
                                        <td>
                                            <img src="${item.product.url}" width="242" height="200">
                                        </td>
                                        <td>
                                                ${item.product.name}&nbsp;&nbsp;
                                                ${item.item.size}&nbsp;&nbsp;${item.item.color}
                                        </td>
                                        <td>
                                            单价<span class="glyphicon glyphicon-yen"
                                                    aria-hidden="true"></span>${item.product.offPrice}
                                        </td>
                                        <td>
                                                ${item.item.count}
                                        </td>
                                        <td>
                                            <span class="glyphicon glyphicon-yen" aria-hidden="true"></span>
                                                ${item.item.subtotal}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <table class="table table-condensed">
                        <tr>
                            <td class="text-right">运费：<span class="glyphicon glyphicon-yen"
                                                            aria-hidden="true"></span>${orderVo.order.freight}
                            </td>
                        </tr>
                        <tr>
                            <td class="text-right">订单总金额（含运费）：<span class="glyphicon glyphicon-yen"
                                                                    aria-hidden="true"></span>${orderVo.order.total}
                            </td>
                        </tr>
                    </table>
                    <div class="col-md-12 text-right">


                        <button class="btn btn-primary" id="back" type="button"
                                onclick="javascript:location.href='${pageContext.request.contextPath}/order/orderList'">
                            返回订单列表
                        </button>
                    </div>
                </div>

            </div>

        </div>
    </div>
</div>

<c:import url="../common/adminFooter.jsp"/>

</body>
</html>